package test
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	import level4.engines.GameEngine;
	import level4.interfaces.IGameComponent;

	public class GameEngineTest extends Sprite
	{
		public function GameEngineTest()
		{
			
			for(var i:int =0;i<10;i++){
				var c:Comp = new Comp(i);
					c.x = Math.random() * 400;
					c.y = Math.random() * 300;
				addChild(c);
				GameEngine.addComponent(c);
			}
			
			addEventListener(MouseEvent.CLICK,onClick);
		}
		private function onClick(e:MouseEvent):void{
			//GameEngine.stopGame();
			while(numChildren != 0){
				removeChildAt(0);
			}
		}
	}
}